home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / gnulib / ohlutil / msd_pwd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-24  |  2.3 KB  |  77 lines

  1. /*  msd_pwd.h - Try to approximate UN*X's getuser...() functions under MS-DOS.
  2.     Copyright (C) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  3.  
  4.     This program is free software; you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation; either version 1, or (at your option)
  7.     any later version.
  8.  
  9.     This program is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.     GNU General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU General Public License
  15.     along with this program; if not, write to the Free Software
  16.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.     IMPORTANT:
  19.  
  20.     This code is not an official part of the GNU project and the
  21.     author is not affiliated to the Free Software Foundation.
  22.     He just likes their code and spirit.
  23.  
  24.     $Header: e:/gnu/fileutil/RCS/msd_pwd.h'v 2.0 90/06/29 00:35:38 tho Stable $
  25. */
  26.  
  27. /* This 'implementation' is conjectured from the use of this functions in
  28.    the RCS and BASH distributions.  Of course these functions don't do too
  29.    much useful things under MS-DOS, but using them avoids many "#ifdef
  30.    MSDOS" in ported UN*X code ...  */
  31.  
  32.  
  33. struct passwd
  34. {
  35.   /*     ...         */
  36.   /* missing stuff */
  37.   /*     ...         */
  38.   char *pw_name;        /* login user id        */
  39.   char *pw_dir;            /* home directory        */
  40.   char *pw_shell;        /* login shell            */
  41. };
  42.  
  43. struct group
  44. {
  45.   /*     ...         */
  46.   /* missing stuff */
  47.   /*     ...         */
  48.   char *gr_name;        /* login user id        */
  49. };
  50.  
  51. extern struct passwd *getpwuid (int);
  52. extern struct passwd *getpwnam (char *);
  53. extern struct group *getgrgid (int);
  54. extern char *getlogin (void);
  55. extern char *getgr_name (void);
  56. extern int getuid (void);
  57. extern int getgid (void);
  58. extern int geteuid (void);
  59. extern int getegid (void);
  60.  
  61. extern int *groups;
  62. extern int ngroups;
  63. extern int getgroups (int, int *);
  64.  
  65. extern struct passwd *getpwent (void);
  66. extern void setpwent (void);
  67. extern void endpwent (void);
  68.  
  69.  
  70. /*
  71.  * Local Variables:
  72.  * mode:C
  73.  * ChangeLog:ChangeLog
  74.  * compile-command:make
  75.  * End:
  76.  */
  77.